﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.SessionState;

namespace planet_express
{
    public class Global : System.Web.HttpApplication
    {
        private static int totalNumberOfUsers = 0;
        private static int currentNumberOfUsers = 0;
        private static List<int> ofertas = null;

        protected void Application_Start(object sender, EventArgs e)
        {
            ofertas = new List<int>();

            for (int i = 1; i < 6; i++)
            {
                if(i != 2) ofertas.Add(i);
            }

        }
        protected void Session_Start(object sender, EventArgs e)
        {
            Session.Timeout = 30;
            totalNumberOfUsers += 1;
            currentNumberOfUsers += 1;
        }

        protected void Application_BeginRequest(object sender, EventArgs e)
        {

        }

        protected void Application_AuthenticateRequest(object sender, EventArgs e)
        {

        }

        protected void Application_Error(object sender, EventArgs e)
        {

        }

        protected void Session_End(object sender, EventArgs e)
        {
        }

        protected void Application_End(object sender, EventArgs e)
        {

        }

        public static int TotalNumberOfUsers
        {
            get
            {
                return totalNumberOfUsers;
            }
        }

        public static int CurrentNumberOfUsers
        {
            get
            {
                return currentNumberOfUsers;
            }
        }

        public static List<int> Ofertas
        {
            get { return ofertas; }
            set { ofertas = new List<int>(value); }
        }
    }
}
